package com.example.Windturbine.Service.Impl;

import com.example.Windturbine.Dao.ChickenDOMapper;
import com.example.Windturbine.Dao.QADOMapper;
import com.example.Windturbine.Dao.UserActionDOMapper;
import com.example.Windturbine.DataObject.QADO;
import com.example.Windturbine.DataObject.UserActionDO;
import com.example.Windturbine.Error.BusinessException;
import com.example.Windturbine.QA.QARobot;
import com.example.Windturbine.Service.QaRobotService;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Author 丁永新
 * @Date 2022/2/5
 */
@Service
public class QaRobotServiceImpl implements QaRobotService {


    @Resource
    QADOMapper qadoMapper;

    @Resource
    UserActionDOMapper UserActionDOMapper;

    @Resource
    RedisTemplate redisTemplate;

    @Resource
    ChickenDOMapper chickenDOMapper;

    @Override
    public String query(String question,Integer userid) {
        QARobot qaRobot=new QARobot(chickenDOMapper,qadoMapper,UserActionDOMapper,redisTemplate,userid);
        String res= qaRobot.query(question);
        return res;
    }

}
